const parseParams = (jsonString) => {
  let obj = {};

  try {
    obj = JSON.parse(decodeURIComponent(jsonString));
  } catch (e) {
    console.warn(e);
    console.warn(jsonString);
    console.warn(decodeURIComponent(jsonString));
  }

  // 需要转换为数字
  if (typeof obj.sort === 'string') {
    obj.sort = parseInt(obj.sort);
  }

  return obj;
};

export { parseParams };
